package br.com.californiahotel.client.viewControler.apartamento;

import br.com.californiahotel.client.architecture.viewController.MaintenanceView;
import br.com.californiahotel.client.viewControler.apartamento.ApartamentoController.Display;

import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.widgets.IButton;
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.layout.HLayout;

public class ApartamentoView extends MaintenanceView implements Display {

	private IButton apTypeButton;

	public ApartamentoView() {

	}

	@Override
	protected void mountPanel() {
		super.mountPanel();
		mountButtonPanel();
	}

	private void mountButtonPanel() {
		HLayout hLayout = new HLayout();
		hLayout.setAlign(Alignment.RIGHT);
		hLayout.setPadding(10);

		apTypeButton = new IButton("Tipos de Apartamento");
		apTypeButton.setAutoFit(true);

		hLayout.addMember(apTypeButton);
		addMember(hLayout);
	}

	@Override
	public IButton getApTypeButton() {
		return apTypeButton;
	}

	@Override
	protected void mountGrid() {
		getGrid().setFields(new ListGridField[] {
				new ListGridField("numeroApartamento", "Apartamento"),
				new ListGridField("tipo", "Tipo") });
	}

}
